const Controller = require('../controllers/orders')

const documentation = require('../schema/orders')

const routes = [
    {
        method: 'POST',
        url: '',
        handler: Controller.addOrders,
        config: {
            tag: 'orders'
        },
        schema: documentation.postOrdersSchema
    },
    {
        method: 'GET',
        url: '',
        handler: Controller.getOrders,
        config: {
            tag: 'orders'
        },
        schema: documentation.getOrdersSchema
    },
    {
        method: 'GET',
        url: '/:orderId',
        handler: Controller.getOrdersDetail,
        config: {
            tag: 'orders'
        },
        schema: documentation.getOrdersDetailSchema
    },
    {
        method: 'DELETE',
        url: '/:orderId',
        handler: Controller.deleteOrders,
        config: {
            tag: 'orders'
        },
        schema: documentation.deleteOrdersSchema
    },
    {
        method: 'GET',
        url: 'getByPetId/:petId',
        handler: Controller.getOrdersbyPetId,
        config: {
            tag: 'orders'
        },
        schema: documentation.getOrdersbyPetIdSchema
    },
]

module.exports = routes